# Maintainer: David Sugar <tychosoft@gmail.com>
# Contributor: David Sugar <tychosoft@gmail.com>
pkgname=webforcpp
pkgver=0.1.2
pkgrel=0
pkgdesc="Modern C++17 header-only library for web services"
url="https://gitlab.com/tychosoft/webforcpp"
arch="noarch"
license="MIT"
makedepends="cmake openssl-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://gitlab.com/tychosoft/webforcpp/-/archive/v$pkgver/webforcpp-v$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-v$pkgver

build() {
	cmake \
		-DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release .
	make
}

check() {
	make test
}

package() {
	DESTDIR="$pkgdir" make install
	install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
	install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
	install -Dm644 FEATURES.md "$pkgdir"/usr/share/doc/$pkgname/FEATURES.md
}

sha512sums="
e6b53284a4813a21de6a80f550306304b2571106f54acb1dc38fd1cd470a01add0964e58254f5f97df4eab7b3ebcb4b3b5aad1ce6d224f24fa5d91a88f80271f  webforcpp-v0.1.2.tar.gz
"
